<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: svg   test.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1316139452.08" />
	<link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1316139452.08" />

    <script type="text/javascript" src="assets/api-js?stamp=1316139452.08"></script>
    <script type="text/javascript" src="assets/ac-js?stamp=1316139452.08"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="g-javascript-lib">g-javascript-lib</a></h1>
        <h3>svg&nbsp; <span class="subtitle">1.0.0</span></h3>
        <a href="./index.html" title="g-javascript-lib">g-javascript-lib</a> 
            &gt; <a href="./module_svg.html" title="svg">svg</a>
                
                 &gt; test.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight"><pre><span class="cm">/**</span>
<span class="cm"> * Unit test framework for Javascript</span>
<span class="cm"> * @module test</span>
<span class="cm"> *</span>
<span class="cm"> */</span>
<span class="p">(</span><span class="kd">function</span><span class="p">(){</span>

	<span class="cm">/**</span>
<span class="cm">	 * TestSuit is a sequence of test case. The test case will be run one by one</span>
<span class="cm">	 * and the result will be saved to a list of passed or failed based on the </span>
<span class="cm">	 * result.&lt;/br&gt;</span>
<span class="cm">	 * TestSuilt also provide a console to show messages during testing.</span>
<span class="cm">	 * @class TestSuit</span>
<span class="cm">	 * @namespace Test</span>
<span class="cm">	 */</span>
	<span class="kd">var</span> <span class="nx">TestSuilt</span> <span class="o">=</span> <span class="nx">G</span><span class="p">.</span><span class="nx">GClass</span><span class="p">(</span><span class="s1">&#39;Test&#39;</span><span class="p">,</span> <span class="s1">&#39;TestSuit&#39;</span><span class="p">);</span>

	<span class="cm">/**</span>
<span class="cm">	 * Constructure of TestSuilt</span>
<span class="cm">	 * </span>
<span class="cm">	 * @method __init</span>
<span class="cm">	 * @param title {string} name of the TestSuit</span>
<span class="cm">	 * @param container{string/DOM Element} the container to show the test console</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">__init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">title</span><span class="p">,</span> <span class="nx">container</span><span class="p">)</span> <span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">title</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">testCaseList</span> <span class="o">=</span> <span class="p">[];</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">passed</span> <span class="o">=</span> <span class="p">[];</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">failed</span> <span class="o">=</span> <span class="p">[];</span>

		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">stopOnError</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

		<span class="k">this</span><span class="p">.</span><span class="nx">init_console</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Create a div for test message output, a list for passed case and a list </span>
<span class="cm">	 * for failed.</span>
<span class="cm">	 * @method init_console</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">init_console</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">container</span><span class="p">)</span> 
	<span class="p">{</span>
		<span class="k">if</span> <span class="p">(</span><span class="k">typeof</span><span class="p">(</span><span class="nx">container</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;string&#39;</span><span class="p">)</span> <span class="p">{</span>
			<span class="nx">container</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="nx">container</span><span class="p">);</span>
		<span class="p">}</span>

		<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">container</span><span class="p">)</span> <span class="p">{</span>
			<span class="k">return</span><span class="p">;</span>
		<span class="p">}</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">);</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;TEST_CONSOLE&quot;</span><span class="p">;</span>
		<span class="nx">container</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Add a test case to test suit.</span>
<span class="cm">	 * @function add_case</span>
<span class="cm">	 * @param testCase {object} instance of a TestCase</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">add_case</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">testCase</span><span class="p">)</span> <span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">testCaseList</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">testCase</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Clear the message box and passed/failed list.</span>
<span class="cm">	 * @function clear_msg</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">clear_msg</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> 
	<span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span><span class="p">.</span><span class="nx">inerHTML</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>

		<span class="k">this</span><span class="p">.</span><span class="nx">passed</span> <span class="o">=</span> <span class="p">[];</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">failed</span> <span class="o">=</span> <span class="p">[];</span>
	<span class="p">}</span>

	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">_add_passed</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">testCase</span><span class="p">)</span> 
	<span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">passed</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">testCase</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">_add_failed</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">testCase</span><span class="p">)</span> 
	<span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">failed</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">testCase</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Create a new log in message box.</span>
<span class="cm">	 * @function log</span>
<span class="cm">	 * @param msg &lt;string&gt; text of message</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">log</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">msg</span><span class="p">)</span> 
	<span class="p">{</span>
		<span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;b&quot;</span><span class="p">);</span>
		<span class="nx">b</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;LOG&quot;</span><span class="p">;</span>
		<span class="nx">b</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">msg</span> <span class="o">+</span> <span class="s2">&quot;&lt;/br&gt;&quot;</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">b</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Create a new error message in message box</span>
<span class="cm">	 * @function err</span>
<span class="cm">	 * @param msg &lt;string&gt; text of error message</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">err</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">msg</span><span class="p">)</span> 
	<span class="p">{</span>
		<span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;b&quot;</span><span class="p">);</span>
		<span class="nx">b</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;ERR&quot;</span><span class="p">;</span>
		<span class="nx">b</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">msg</span> <span class="o">+</span> <span class="s2">&quot;&lt;/br&gt;&quot;</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">divConsole</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">b</span><span class="p">);</span>
	<span class="p">}</span>


	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">__step</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span>
	<span class="p">{</span>
		<span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentCase</span><span class="p">;</span>
		<span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">testCaseList</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
			<span class="kd">var</span> <span class="nx">cs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">testCaseList</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Run case: &quot;</span> <span class="o">+</span> <span class="nx">cs</span><span class="p">.</span><span class="nx">title</span> <span class="o">+</span> <span class="s2">&quot; ...&quot;</span><span class="p">);</span>
			<span class="kd">var</span> <span class="nx">_self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

			<span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
				<span class="kd">var</span> <span class="nx">dat</span> <span class="o">=</span> <span class="nx">cs</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span> 

				<span class="k">if</span> <span class="p">(</span><span class="nx">_self</span><span class="p">.</span><span class="nx">stopOnError</span><span class="p">)</span> <span class="p">{</span>
					<span class="nx">cs</span><span class="p">.</span><span class="nx">run</span><span class="p">();</span>
					<span class="nx">_self</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;ok&quot;</span><span class="p">);</span>
					<span class="nx">_self</span><span class="p">.</span><span class="nx">_add_passed</span><span class="p">(</span><span class="nx">cs</span><span class="p">);</span>
				<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
					<span class="k">try</span> <span class="p">{</span>
						<span class="nx">cs</span><span class="p">.</span><span class="nx">run</span><span class="p">();</span>
						<span class="nx">_self</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;ok&quot;</span><span class="p">);</span>
						<span class="nx">_self</span><span class="p">.</span><span class="nx">_add_passed</span><span class="p">(</span><span class="nx">cs</span><span class="p">);</span>
					<span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">){</span>
						<span class="nx">_self</span><span class="p">.</span><span class="nx">err</span><span class="p">(</span><span class="s2">&quot;Failed: &quot;</span> <span class="o">+</span> <span class="nx">e</span><span class="p">.</span><span class="nx">message</span><span class="p">);</span>
						<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
						<span class="nx">_self</span><span class="p">.</span><span class="nx">_add_failed</span><span class="p">(</span><span class="nx">cs</span><span class="p">);</span>
					<span class="p">}</span>
				<span class="p">}</span>
				<span class="nx">_self</span><span class="p">.</span><span class="nx">currentCase</span> <span class="o">+=</span> <span class="mi">1</span><span class="p">;</span>
				<span class="nx">_self</span><span class="p">.</span><span class="nx">__step</span><span class="p">();</span>
			<span class="p">},</span> <span class="mi">10</span><span class="p">);</span>
		<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;=========================================&quot;</span><span class="p">);</span>
			<span class="kd">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">failed</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
			<span class="k">if</span> <span class="p">(</span><span class="nx">len</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
				<span class="k">this</span><span class="p">.</span><span class="nx">err</span><span class="p">(</span><span class="s2">&quot;Failed on:&quot;</span><span class="p">);</span>
				<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
					<span class="k">this</span><span class="p">.</span><span class="nx">err</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">failed</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">title</span><span class="p">);</span>
				<span class="p">}</span>
			<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
				<span class="k">this</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Failed: None.&quot;</span><span class="p">);</span>
			<span class="p">}</span>
		<span class="p">}</span>
	<span class="p">}</span>


	<span class="cm">/**</span>
<span class="cm">	 * Run the test suit.</span>
<span class="cm">	 * @function run</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestSuit</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">run</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> 
	<span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">currentCase</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">__step</span><span class="p">();</span>
	<span class="p">}</span>

	
	<span class="cm">/**</span>
<span class="cm">	 * TestCase belong to a TestSuit. TestSuit run the case one by one by call </span>
<span class="cm">	 * it&#39;s init() and run() function.  assert() function will check the result</span>
<span class="cm">	 * and terminate the test case on failed.</span>
<span class="cm">	 *</span>
<span class="cm">	 * @class TestCase</span>
<span class="cm">	 */</span>
	<span class="nx">TestCase</span> <span class="o">=</span> <span class="nx">G</span><span class="p">.</span><span class="nx">GClass</span><span class="p">(</span><span class="s1">&#39;Test&#39;</span><span class="p">,</span> <span class="s1">&#39;TestCase&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">title</span><span class="p">,</span> <span class="nx">init</span><span class="p">,</span> <span class="nx">run</span><span class="p">,</span> <span class="nx">expect</span><span class="p">)</span> <span class="p">{</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">__init</span><span class="p">(</span><span class="nx">title</span><span class="p">,</span> <span class="nx">init</span><span class="p">,</span> <span class="nx">run</span><span class="p">,</span> <span class="nx">expect</span><span class="p">);</span>
	<span class="p">});</span>


	<span class="cm">/**</span>
<span class="cm">	 * @function __init</span>
<span class="cm">	 */</span>
	<span class="nx">TestCase</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">__init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">title</span><span class="p">,</span> <span class="nx">init</span><span class="p">,</span> <span class="nx">run</span><span class="p">,</span> <span class="nx">expect</span><span class="p">)</span> <span class="p">{</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">title</span><span class="p">;</span>

		<span class="k">this</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="nx">init</span> <span class="o">||</span> <span class="kd">function</span><span class="p">(){</span><span class="k">return</span> <span class="kc">null</span><span class="p">};</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">run</span> <span class="o">=</span> <span class="nx">run</span> <span class="o">||</span> <span class="kd">function</span><span class="p">(){</span><span class="k">return</span> <span class="s2">&quot;ok&quot;</span><span class="p">};</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">expect</span> <span class="o">=</span> <span class="nx">expect</span> <span class="o">||</span> <span class="s2">&quot;ok&quot;</span><span class="p">;</span>
	<span class="p">};</span>


	<span class="cm">/**</span>
<span class="cm">	 * Check value the expression and terminate the current test case if the value is </span>
<span class="cm">	 * not true</span>
<span class="cm">	 * @function assert</span>
<span class="cm">	 * @param exp &lt;string&gt; the expression to check the value true or false</span>
<span class="cm">	 * @param msg &lt;string&gt; the error message that will show on error.</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestCase</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">assert</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">exp</span><span class="p">,</span> <span class="nx">msg</span><span class="p">)</span>
	<span class="p">{</span>
		<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">exp</span><span class="p">)</span> <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="nx">msg</span><span class="p">);</span>	
	<span class="p">}</span>

	<span class="cm">/**</span>
<span class="cm">	 * Check if the two value are equal, and terminate the test case if it&#39;s not.</span>
<span class="cm">	 * @function assert_equ</span>
<span class="cm">	 */</span>
	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestCase</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">assert_equ</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">result</span><span class="p">,</span> <span class="nx">expect</span><span class="p">,</span> <span class="nx">msgHead</span><span class="p">)</span> <span class="p">{</span>
		<span class="kd">var</span> <span class="nx">msgHead</span> <span class="o">=</span> <span class="nx">msgHead</span> <span class="o">||</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
		<span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="nx">msgHead</span> <span class="o">+</span> <span class="s2">&quot; Expect:[&quot;</span> <span class="o">+</span> <span class="nx">expect</span> <span class="o">+</span> <span class="s2">&quot;] got [&quot;</span> <span class="o">+</span> <span class="nx">result</span> <span class="o">+</span> <span class="s2">&quot;]&quot;</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">assert</span><span class="p">(</span><span class="nx">result</span><span class="o">==</span><span class="nx">expect</span><span class="p">,</span> <span class="nx">msg</span><span class="p">);</span>
	<span class="p">}</span>

	<span class="nx">G</span><span class="p">.</span><span class="nx">Test</span><span class="p">.</span><span class="nx">TestCase</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">assert_neq</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">result</span><span class="p">,</span> <span class="nx">expect</span><span class="p">,</span> <span class="nx">msgHead</span><span class="p">)</span> <span class="p">{</span>
		<span class="kd">var</span> <span class="nx">msgHead</span> <span class="o">=</span> <span class="nx">msgHead</span> <span class="o">||</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
		<span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="nx">msgHead</span> <span class="o">+</span> <span class="s2">&quot; Got unexpected result[&quot;</span> <span class="o">+</span> <span class="nx">result</span> <span class="o">+</span> <span class="s2">&quot;]&quot;</span><span class="p">;</span>
		<span class="k">this</span><span class="p">.</span><span class="nx">assert</span><span class="p">(</span><span class="nx">result</span><span class="o">!=</span><span class="nx">expect</span><span class="p">,</span> <span class="nx">msg</span><span class="p">);</span>
	<span class="p">}</span>

<span class="p">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_base.html" title="base">base</a></li>
                                <li class="selected"><a href="module_svg.html" title="svg">svg</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class=""><a href="module_utils.html" title="utils">utils</a></li>
                                <li class=""><a href="module_widget.html" title="widget">widget</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="SVG.Board.html" title="SVG.Board">SVG.Board</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="drawmode.js.html" title="drawmode.js">drawmode.js</a></li>
                                <li class="selected"><a href="test.js.html" title="test.js">test.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"url": "SVG.Board.html#method_add_background", "access": "", "host": "SVG.Board", "type": "method", "name": "add_background"}, {"url": "SVG.Board.html#method_add_element", "access": "", "host": "SVG.Board", "type": "method", "name": "add_element"}, {"url": "SVG.Board.html#method_add_use", "access": "", "host": "SVG.Board", "type": "method", "name": "add_use"}, {"url": "SVG.Board.html#method_def_symbol", "access": "", "host": "SVG.Board", "type": "method", "name": "def_symbol"}, {"url": "SVG.Board.html#method__draw_cursor", "access": "", "host": "SVG.Board", "type": "method", "name": "_draw_cursor"}, {"url": "SVG.Board.html#method__draw_grid", "access": "", "host": "SVG.Board", "type": "method", "name": "_draw_grid"}, {"url": "SVG.Board.html#method_find_event_obj", "access": "", "host": "SVG.Board", "type": "method", "name": "find_event_obj"}, {"url": "SVG.Board.html#method__fix_scale", "access": "", "host": "SVG.Board", "type": "method", "name": "_fix_scale"}, {"url": "SVG.Board.html#method_load_hot_key", "access": "", "host": "SVG.Board", "type": "method", "name": "load_hot_key"}, {"url": "SVG.Board.html#method__map_mouse_matrix", "access": "", "host": "SVG.Board", "type": "method", "name": "_map_mouse_matrix"}, {"url": "SVG.Board.html#method_mirror", "access": "", "host": "SVG.Board", "type": "method", "name": "mirror"}, {"url": "SVG.Board.html#method_move_cursor", "access": "", "host": "SVG.Board", "type": "method", "name": "move_cursor"}, {"url": "SVG.Board.html#method__on_resize", "access": "", "host": "SVG.Board", "type": "method", "name": "_on_resize"}, {"url": "SVG.Board.html#method_remove_element", "access": "", "host": "SVG.Board", "type": "method", "name": "remove_element"}, {"url": "SVG.Board.html#method_render", "access": "", "host": "SVG.Board", "type": "method", "name": "render"}, {"url": "SVG.Board.html#method_set_grid", "access": "", "host": "SVG.Board", "type": "method", "name": "set_grid"}, {"url": "SVG.Board.html#method_set_scale_step", "access": "", "host": "SVG.Board", "type": "method", "name": "set_scale_step"}, {"url": "SVG.Board.html#method_set_size", "access": "", "host": "SVG.Board", "type": "method", "name": "set_size"}, {"url": "SVG.Board.html#method_set_view", "access": "", "host": "SVG.Board", "type": "method", "name": "set_view"}, {"url": "SVG.Board.html#method__snap_to_grid", "access": "", "host": "SVG.Board", "type": "method", "name": "_snap_to_grid"}, {"url": "SVG.Board.html#method__update_matrix", "access": "", "host": "SVG.Board", "type": "method", "name": "_update_matrix"}, {"url": "SVG.Board.html#method__update_scale_range", "access": "", "host": "SVG.Board", "type": "method", "name": "_update_scale_range"}, {"url": "SVG.Board.html#method_view_grid", "access": "", "host": "SVG.Board", "type": "method", "name": "view_grid"}, {"url": "SVG.Board.html#method_zoom_fit", "access": "", "host": "SVG.Board", "type": "method", "name": "zoom_fit"}];
</script>
</body>
</html>
